﻿using System;
using System.Collections.Generic;
using System.Text;
using DotNet.Data;
using DotNet.Model;
namespace DotNet.Business
{
	public class AnswerBll
	{
		AnswerDal aDal=new AnswerDal();

		#region 是否存在该记录
		/// <summary>
		/// 是否存在该记录
		/// </summary>
		public bool Exists(int AnswerID)
		{
			return aDal.Exists(AnswerID);
		}
		#endregion

		#region 获得数据列表
		/// <summary>
		/// 获得数据列表
		/// </summary>
		public IList<Answer> GetModel()
		{
			return aDal.GetModel();
		}
		#endregion

        #region 根据问题id获得数据列表---郑同飞
        /// <summary>
        /// 根据问题id获得数据列表---郑同飞
        /// </summary>
        public IList<Answer> GetListByQuestionID(int QuestionID)
        {
            return aDal.GetListByQuestionID(QuestionID);
        }
        #endregion

		#region 根据标识列获得数据实体
		/// <summary>
		/// 根据标识列获得数据实体
		/// </summary>
		/// <param name="AnswerID">标识列</param>
		/// <returns></returns>
		public Answer GetModel(int AnswerID)
		{
			return aDal.GetModel(AnswerID);
		}
		#endregion

        #region 根据问题id获得实体---郑同飞
        /// <summary>
        /// 根据问题id获得实体
        /// </summary>
        /// <param name="questionID">问题id</param>
        /// <returns></returns>
        public Answer GetModelByQid(int questionID)
        {
            return aDal.GetModelByQid(questionID);
        }
        #endregion

        #region 修改信息
        /// <summary>
		/// 修改信息
		/// </summary>
		/// <param name="Answer">实体</param>
		/// <returns></returns>
		public bool Update(Answer answer)
		{
			 return aDal.Update(answer);
		}
		#endregion

        #region 根据问题修改信息
        /// <summary>
        /// 根据问题修改信息
        /// </summary>
        /// <param name="questionList">问题id</param>
        /// <returns></returns>
        public bool Update(int questionID)
        {
            return aDal.Update(questionID);
        }
        #endregion

		#region 删除信息
		/// <summary>
		/// 删除信息
		/// </summary>
		/// <param name="AnswerID">标识列</param>
		/// <returns></returns>
		public bool Delete(int AnswerID)
		{
			 return aDal.Delete(AnswerID);
		}
		#endregion

        #region 根据问题id删除回答---郑同飞
        /// <summary>
        /// 根据问题id删除回答---郑同飞
        /// </summary>
        /// <param name="questions">问题id</param>
        /// <returns></returns>
        public bool DeleteID(int questionId)
        {
            return aDal.DeleteID(questionId);           
        }
        #endregion

        #region 添加信息
        /// <summary>
		/// 添加信息
		/// </summary>
		/// <param name="Answer">实体</param>
		/// <returns></returns>
		public bool Insert(Answer answer)
		{
			 return aDal.Insert(answer);
		}
		#endregion

        #region 根据问题状态问题id获得数量
        /// <summary>
        /// 根据问题状态问题id获得数量
        /// </summary>
        /// <param name="strList"></param>
        /// <param name="IsSee"></param>
        /// <returns></returns>
        public int getCount(IList<int> qidList, bool IsSee)
        {
            return aDal.getCount(qidList, IsSee);
        }
        #endregion

        #region 根据问题获取最近的回复---郑同飞
        /// <summary>
        /// 根据问题获取最近的回复---郑同飞
        /// </summary>
        /// <param name="qidList"></param>
        /// <returns></returns>
        public Answer getLastAnswer(IList<int> qidList) 
        {
            return aDal.getLastAnswer(qidList);
        }
        #endregion
    }
}
